package com.nidu.demo.mail.dto;

import com.nidu.demo.base.BaseCmd;
import com.nidu.demo.common.enums.StatusEnum;
import com.nidu.demo.common.validation.InEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 邮件模板添加命令
 *
 * @author auto
 */
@Data
@Schema(description = "邮件模板添加命令")
@EqualsAndHashCode(callSuper = true)
public class MailTemplateAddCmd extends BaseCmd {

    @NotNull(message = "邮箱账号编号不能为空")
    @Schema(description = "发送的邮箱账号编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Long accountId;

    @NotBlank(message = "模板名称不能为空")
    @Size(max = 64, message = "模板名称长度不能超过64个字符")
    @Schema(description = "模板名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "用户注册邮件")
    private String templateName;

    @NotBlank(message = "模板编码不能为空")
    @Size(max = 64, message = "模板编码长度不能超过64个字符")
    @Schema(description = "模板编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "USER_REGISTER")
    private String templateCode;

    @Size(max = 255, message = "发送人名称长度不能超过255个字符")
    @Schema(description = "发送人名称", example = "系统管理员")
    private String templateNickname;

    @NotBlank(message = "模板标题不能为空")
    @Size(max = 255, message = "模板标题长度不能超过255个字符")
    @Schema(description = "模板标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "欢迎注册")
    private String templateTitle;

    @NotBlank(message = "模板内容不能为空")
    @Size(max = 10240, message = "模板内容长度不能超过10240个字符")
    @Schema(description = "模板内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "欢迎您注册我们的系统")
    private String templateContent;

    @NotBlank(message = "参数数组不能为空")
    @Size(max = 255, message = "参数数组长度不能超过255个字符")
    @Schema(description = "参数数组", requiredMode = Schema.RequiredMode.REQUIRED, example = "[\"username\", \"email\"]")
    private String templateParams;

    @Size(max = 255, message = "备注长度不能超过255个字符")
    @Schema(description = "备注", example = "用户注册时发送的邮件模板")
    private String remark;

}
